package com.ken.apollo.controller;


import com.ken.apollo.commons.result.R;
import com.ken.apollo.domain.entity.Language;
import com.ken.apollo.service.LanguageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 语言表(Language)表控制层
 *
 * @author makejava
 * @since 2025-06-09 20:11:40
 */
@RestController
@RequestMapping("/api/language")
public class LanguageController {
    /**
     * 服务对象
     */
    @Resource
    private LanguageService languageService;


    /**
     * 新增语言
     */
    @PostMapping("/save")
    public R<Boolean> save(Language language) {
        return R.success(languageService.save(language));
    }

    /**
     * 查询语言列表
     */
    @GetMapping("/list")
    public R<List<Language>> list() {
        return R.success(languageService.list());
    }

    /**
     * 根据ID删除语言
     */
    @GetMapping("/remove")
    public R<Boolean> removeById(Long id) {
        return R.success(languageService.removeById(id));
    }
}

